package live.hotel.entity;

import java.io.Serializable;


public class Availability implements Serializable{
	private static final long serialVersionUID = -2405458326833126724L;
	private String date;
	/*
	 * 房间状态 不可预订： -1:已关闭 -3:满房 -4:房紧 可以预订： -2:不限配额 -5:有房 0:申请 >0:剩X间
	 */
	private int status;
	private boolean state;
	private String statuText;

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getStatuText() {
		switch (status) {
		// 不可预定
		case -1:
			statuText = "已关闭";
			break;
		case -3:
			statuText = "满房";
			break;
		case -4:
			statuText = "房紧";
			break;
		// 可以预定
		case -2:
			statuText = "不限配额";
			break;
		case -5:
			statuText = "有房";
			break;
		case 0:
			statuText = "申请";
			break;
		default:
			statuText = "还剩" + status + "间";
			break;
		}
		return statuText;
	}

	public boolean isState() {
		switch (status) {
		// 不可预定
		case -1:
		case -3:
		case -4:
			state = false;
			break;
		// 可以预定
		default:
			state = true;
			break;
		}
		return state;
	}
}
